package kr.co.sharping.Fragment;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.ListFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class f_write_tab1 extends ListFragment {

	private mAdapter adapter;
	private ArrayList<WriteBizInfo> list;

	@Override
	public void onAttach(Activity activity) {
		super.onAttach(activity);
		list = new ArrayList<f_write_tab1.WriteBizInfo>();
	}
	
	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);

		if (adapter == null) {
			adapter = new mAdapter(getActivity(), list);
		}
		setListAdapter(adapter);
	}
	
	private class mAdapter extends ArrayAdapter<WriteBizInfo> {

		LayoutInflater inflater;
		
		public mAdapter(Context context, List<WriteBizInfo> objects) {
			super(context, 0, objects);
			
			inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		}
		
		@Override
		public View getView(int position, View convertView, ViewGroup parent) {
			
			ListItem v;
			
			if (convertView == null) {
				convertView = inflater.inflate(0, null);
				v = new ListItem();
				
				convertView.setTag(v);
			} else {
				v = (ListItem) convertView.getTag();
			}
			
			return convertView;
		}
		
	}
	
	private class ListItem {
		public ImageView img_category;
		public TextView text_bizname;
		public TextView text_distance;
	}
	
	private class WriteBizInfo {
		
	}
}
